package com.gaohe.dcp.service.impl;

import java.util.List;
import com.gaohe.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gaohe.dcp.mapper.DcpDoctorMapper;
import com.gaohe.dcp.domain.DcpDoctor;
import com.gaohe.dcp.service.IDcpDoctorService;

/**
 * 医生信息Service业务层处理
 * 
 * @author OXXS
 * @date 2025-04-24
 */
@Service
public class DcpDoctorServiceImpl implements IDcpDoctorService 
{
    @Autowired
    private DcpDoctorMapper dcpDoctorMapper;
    @Override
    public String selectPassWord()
    {
        return dcpDoctorMapper.selectPassWord();
    }

    /**
     * 查询医生信息
     * 
     * @param userId 医生信息主键
     * @return 医生信息
     */
    @Override
    public DcpDoctor selectDcpDoctorByUserId(Long userId)
    {
        return dcpDoctorMapper.selectDcpDoctorByUserId(userId);
    }

    /**
     * 查询医生信息列表
     * 
     * @param dcpDoctor 医生信息
     * @return 医生信息
     */
    @Override
    public List<DcpDoctor> selectDcpDoctorList(DcpDoctor dcpDoctor)
    {
        return dcpDoctorMapper.selectDcpDoctorList(dcpDoctor);
    }

    /**
     * 新增医生信息
     * 
     * @param dcpDoctor 医生信息
     * @return 结果
     */
    @Override
    public int insertDcpDoctor(DcpDoctor dcpDoctor)
    {
        dcpDoctor.setCreateTime(DateUtils.getNowDate());
        return dcpDoctorMapper.insertDcpDoctor(dcpDoctor);
    }

    /**
     * 修改医生信息
     * 
     * @param dcpDoctor 医生信息
     * @return 结果
     */
    @Override
    public int updateDcpDoctor(DcpDoctor dcpDoctor)
    {
        dcpDoctor.setUpdateTime(DateUtils.getNowDate());
        return dcpDoctorMapper.updateDcpDoctor(dcpDoctor);
    }

    /**
     * 批量删除医生信息
     * 
     * @param userIds 需要删除的医生信息主键
     * @return 结果
     */
    @Override
    public int deleteDcpDoctorByUserIds(Long[] userIds)
    {
        return dcpDoctorMapper.deleteDcpDoctorByUserIds(userIds);
    }

    /**
     * 删除医生信息信息
     * 
     * @param userId 医生信息主键
     * @return 结果
     */
    @Override
    public int deleteDcpDoctorByUserId(Long userId)
    {
        return dcpDoctorMapper.deleteDcpDoctorByUserId(userId);
    }
}
